package controller

import (
	"go-toy/app/service"
	"go-toy/util"

	"github.com/gin-gonic/gin"
)

type TestController struct {
	Common
}

func (t *TestController) Test1(gc *gin.Context) {
	util.Response.ResponseSuccess(gc, gin.H{"info": "test"})
}

func (t *TestController) Test2(gc *gin.Context) {
	// service.SpiderInstance().IncrUpdateSpiderIndex()
	service.SpiderInstance().FullRenewalSpiderIndex()
}

func (t *TestController) Test3(gc *gin.Context) {
	service.SpiderInstance().SearchFromEs("乔丹", 10, 1)
}

// Singleton instance of SpiderController
var TestControllerInstance *TestController = &TestController{}
